package mybatis.conService;


import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class ServiceFactory {
	
	private static SqlSessionFactory factory;
	
	static{
		try{
		Reader r = Resources.getResourceAsReader("mybatis/conService/sqlMapConfig.xml");
		factory = new SqlSessionFactoryBuilder().build(r);
		r.close();
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}

	public static SqlSessionFactory getFactory() {
		return factory;
	}
}
